package cn.xluobo.business.wechat.miniapp.student.service;

import cn.xluobo.business.sc.student.domain.req.ReqSearchStudentCourse;
import cn.xluobo.business.sc.student.domain.resp.RespStudentCourse;
import cn.xluobo.business.sc.student.repo.mapper.ScStudentCourseMapper;
import cn.xluobo.config.login.LoginUser;
import cn.xluobo.utils.LoginUserUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author ：KingLong
 * @date ：Created in 2020/11/11 20:23
 */
@Service
public class WechatMiniStudentCourseService {
    @Autowired
    private ScStudentCourseMapper studentCourseMapper;

    /**
     * 学生报读课程列表
     * @param reqSearchStudentCourse
     * @return
     */
    public List<RespStudentCourse> searchStudentCourse(ReqSearchStudentCourse reqSearchStudentCourse) {
        LoginUser loginUser = LoginUserUtil.getLoginUser();
        Long deptId = loginUser.getDeptId();

        reqSearchStudentCourse.setDeptId(deptId);
        reqSearchStudentCourse.setUserId(loginUser.getUserId());
        return studentCourseMapper.selectStudentCourseList(reqSearchStudentCourse);
    }

}
